package com.sixfoot.adminsys;

import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.swing.*;
import java.awt.*;

/**
 * 主入口
 *
 * @author zhangjunjie | 2016-09-27
 */
public class Main {

    private static String[] DEFAULT_FONT = new String[]{"Table.font", "TableHeader.font", "CheckBox.font",
            "Tree.font", "Viewport.font", "ProgressBar.font", "RadioButtonMenuItem.font", "ToolBar.font",
            "ColorChooser.font", "ToggleButton.font", "Panel.font", "TextArea.font", "Menu.font", "TableHeader.font",
            "TextField.font", "OptionPane.font", "MenuBar.font", "Button.font", "Label.font", "PasswordField.font",
            "ScrollPane.font", "MenuItem.font", "ToolTip.font", "List.font", "EditorPane.font", "Table.font",
            "TabbedPane.font", "RadioButton.font", "CheckBoxMenuItem.font", "TextPane.font", "PopupMenu.font",
            "TitledBorder.font", "ComboBox.font"};

    public static ApplicationContext ac = new ClassPathXmlApplicationContext("spring-config.xml","spring-shiro.xml");

    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.generalNoTranslucencyShadow;
                    UIManager.put("RootPane.setupButtonVisible", false);
                    org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
                    for (String aDEFAULT_FONT : DEFAULT_FONT) {
                        UIManager.put(aDEFAULT_FONT, new Font("微软雅黑", Font.PLAIN, 13));
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                LoginFrame frame = new LoginFrame();
                frame.setVisible(true);
            }
        });
    }
}
